﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JControlEx;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string value = DefaultDisplayNameGetter("UserName");
        }

        private static System.Text.RegularExpressions.Regex UpperCaseReplaceRegex = new System.Text.RegularExpressions.Regex("[A-Z]");
        /// <summary>
        /// Default display name getter. Will split the property at upper-case letter.
        /// </summary>
        /// <param name="property">The name of the property.</param>
        /// <returns>The display text.</returns>
        private static string DefaultDisplayNameGetter(string property)
        {
            return UpperCaseReplaceRegex.Replace(property, matches => " " + matches.Value).Trim();
        }
    }
}
